def g(a):
    flag=True
    while flag:
        flag=False
        for i in range(len(a)-1):
            if a[i]>a[i+1]:
                a[i],a[i+1]=a[i+1],a[i]
                flag=True
    return a

from time import*

t1=time()
f1=open('m1_sorted.txt').readlines()
f1=list(map(int,f1))
print(g(f1))
t2=time()
print('m1_sorted', (t2-t1)*100, 'milliseconds')


t1=time()
f1=open('m2_reverse.txt').readlines()
f1=list(map(int,f1))
print(g(f1))
t2=time()
print('m2_reverse', (t2-t1)*100, 'milliseconds')


t1=time()
f1=open('m3_shuffle.txt').readlines()
f1=list(map(int,f1))
print(g(f1))
t2=time()
print('m3_shuffle', (t2-t1)*100, 'milliseconds')
